﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp9
{
    class Library
    {
        //3.定义一个图书类，存放图书的编号、书名、价格、出版社、作者信息；
        //  对价格进行赋值限制，小于0价格，赋值为0
        //  在图书类中定义一个方法输出图书信息；
        //  在主方法实例化对象，赋值并输出

        public int num;
        public string name;
        public int price;
        public string from;
        public string message;
      
        public int Num
        {
            get { return this.num; }
            set { this.num = value; }
        }
        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }
        public string Message
        {
            get { return this.message; }
            set { this.message = value; }
        }
        public int Price
        {
            get { return this.price; }
            set { this.price = value;
                if (price<0)
                {
                    Price = 0;
                }
            }
        }
        public Library(int num,string name,int price,string from,string message )
        {
            this.num = num;
            this.name = name;
            this.price = price;
            this.from=from;
            this.message = message;
        }
        public Library(string message)
        {
            Console.WriteLine("不是");
        }
        public void Jie()
        {
            Console.WriteLine($"编号{num},书名{name},价格{price},出版社{from}, 作者信息{message}"); 
            }
    }
}
